package com.yanqu.road.entity.activity.lanruosi;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.activity.tripletown.IUserData;
import com.yanqu.road.entity.activity.tripletown.Monster;
import com.yanqu.road.entity.activity.tripletown.Order;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_u_activity_lanruosi_user_data")
public class LanRuoSiUserData extends DataObject implements IUserData {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "用户ID", select = true, update = true)
    private long userId;

    @FieldTypeAnnotation(desc = "积分")
    private long score;

    @FieldTypeAnnotation(desc = "体力")
    private int energy;

    @FieldTypeAnnotation(desc = "上次恢复时间")
    private long lastRecTime;

    @FieldTypeAnnotation(desc = "新手引导位置")
    private int guideIndex = 0;

    @FieldTypeAnnotation(desc = "方块列表（1倍）")
    private int[][] blockList1 = new int[6][7];

    @FieldTypeAnnotation(desc = "方块列表（8倍）")
    private int[][] blockList8 = new int[6][7];

    @FieldTypeAnnotation(desc = "方块列表（16倍）")
    private int[][] blockList16 = new int[6][7];

    @FieldTypeAnnotation(desc = "妖怪波次")
    private int waveNum;
    @FieldTypeAnnotation(desc = "妖怪")
    private List<Monster> monsterList = new ArrayList<>();

    @FieldTypeAnnotation(desc = "妖怪循环轮次")
    private int round;

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if(this.activityId != activityId) {
            this.activityId = activityId;
            setUpdateOption();
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public long getScore() {
        return score;
    }

    public void setScore(long score) {
        if(this.score != score) {
            this.score = score;
            setUpdateOption();
        }
    }

    public int getEnergy() {
        return energy;
    }

    public void setEnergy(int energy) {
        if(this.energy != energy) {
            this.energy = energy;
            setUpdateOption();
        }
    }

    public long getLastRecTime() {
        return lastRecTime;
    }

    public void setLastRecTime(long lastRecTime) {
        if(this.lastRecTime != lastRecTime) {
            this.lastRecTime = lastRecTime;
            setUpdateOption();
        }
    }

    @Override
    public int getGuideIndex() {
        return guideIndex;
    }

    public void setGuideIndex(int guideIndex) {
        if(this.guideIndex != guideIndex) {
            this.guideIndex = guideIndex;
            setUpdateOption();
        }
    }

    public int[][] getBlockList1() {
        return blockList1;
    }

    public void setBlockList1(int[][] blockList1) {
        this.blockList1 = blockList1;
        setUpdateOption();
    }

    public int[][] getBlockList8() {
        return blockList8;
    }

    public void setBlockList8(int[][] blockList8) {
        this.blockList8 = blockList8;
        setUpdateOption();
    }

    public int[][] getBlockList16() {
        return blockList16;
    }

    public void setBlockList16(int[][] blockList16) {
        this.blockList16 = blockList16;
        setUpdateOption();
    }

    public int getWaveNum() {
        return waveNum;
    }

    public void setWaveNum(int waveNum) {
        if(this.waveNum != waveNum) {
            this.waveNum = waveNum;
            setUpdateOption();
        }
    }

    public List<Monster> getMonsterList() {
        return monsterList;
    }

    public void setMonsterList(List<Monster> monsterList) {
        this.monsterList = monsterList;
        setUpdateOption();
    }

    public int getRound() {
        return round;
    }

    public void setRound(int round) {
        if(this.round != round) {
            this.round = round;
            setUpdateOption();
        }
    }

    //--------
    @Override
    public int[][] getBlockList(int multi) {
        if (multi == 1){
            return blockList1;
        }
        if (multi == 8){
            return blockList8;
        }
        if (multi == 16){
            return blockList16;
        }
        return null;
    }

    public void setBlockList(int[][] blockList, int multi) {
        if (null == blockList) {
            return;
        }
        if (multi == 1) this.blockList1 = blockList;
        else if (multi == 8) this.blockList8 = blockList;
        else if (multi == 16) this.blockList16 = blockList;
        setOp(DataStatus.Update);
    }

    //兰若寺没有订单模块，但三消通用逻辑支持订单，空实现接口即可
    @Override
    public Order getOrder(int multi) {
        return null;
    }

    @Override
    public List<Integer> getOrderIdList(int multi) {
        return new ArrayList<>();
    }

    // =============== 以下不需要入库 ================

    private long lastTipsTime = 0L;

    public long getLastTipsTime() {
        return lastTipsTime;
    }

    public void setLastTipsTime(long lastTipsTime) {
        this.lastTipsTime = lastTipsTime;
    }

}
